<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    body{
        background:url("picture/1.jpg") no-repeat;
        background-position-y: -120px;
    }
    input{
        width: 300px;
        height: 40px;
    }
</style>
<body>
<input type="text" class="id" placeholder="输入修改书名的id" >
<input type="text" class="title" placeholder="书名">
<button type="button"  class="btn" style="width: 40px;height: 40px;position: relative;top: 10px;"><img src="picture/发送提交.png" style="width: 30px"></button>
<script>
  const btn=document.querySelector('.btn')
  const input=document.querySelectorAll('input')

  btn.onclick=function (){
    const xhr = new XMLHttpRequest()
    xhr.open('POST', 'http://8.130.14.155:8080/user/update', true)
    xhr.setRequestHeader('Content-Type', 'application/json')
    const books = {
      id:input[0].value,
      title:input[1].value,
    }
    xhr.send(JSON.stringify(books))
  }
</script>
</body>
</html>